home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Prog / H-K / HyperStuff.cpt / CFlash.c / CFlash.c
Encoding:
C/C++ Source or Header  |  1988-12-20  |  1.0 KB  |  34 lines  |  [TEXT/KAHL]

  1. /* 
  2.     FILE : CFlash.c
  3.     BUILT: 12/19/88
  4.     FONT : Profont fixed-cell 9 point (available on GEnie)
  5.     FROM : GEnie A.COHEN6
  6.     SOURCE: LightSpeed 'c' v3.0
  7.     TARGET: Macintosh II
  8.  
  9.     NOTE : This is the "Hello World" of HyperCard XCMD's
  10.         
  11.     Taken from Appendix A Pg. 223 of the Apple Hypercard Script Language Guide
  12.     (c)Apple Computer, Inc.
  13. */
  14.  
  15. #include "HyperXCmd.h"
  16.  
  17. pascal void
  18. main(paramPtr)                     /* Note variation: LSC requires "main" as opposed to "CFlash" */
  19. XCmdBlockPtr    paramPtr;
  20. {
  21. short flashCount, again;
  22. GrafPtr    port;
  23. Str31    str;
  24.  
  25.     ZeroToPas(paramPtr, (char *)(paramPtr->params[0]),(StringPtr) &str);/* get flash count     */
  26.     flashCount = StrToNum(paramPtr, &str);                              /* convert to num      */
  27.     if(paramPtr->paramCount !=1)  flashCount = 3;                       /* default if no param */
  28.     if(flashCount < 1)  flashCount = 3;                                 /* must be positive    */
  29.     GetPort(&port);
  30.     for(again = 1; again <= flashCount; again++) {
  31.         InvertRect(&port->portRect);
  32.         InvertRect(&port->portRect);
  33.     }
  34. }